<template>
  <div class="mine-container">
    <div class="container">
      <div class="mine" v-if="user">
        <Mine></Mine>
      </div>
      <div v-else>
        <h1>登录后才可查看此页面</h1>
        <el-button type="primary" @click="goLogin">马上登录</el-button>
      </div>
    </div>
  </div>
</template>

<script>
import Mine from '@/components/mine/Mine.vue'

export default {
  components: {Mine},
  data() {
    return {
      user: localStorage.getItem('user')
    }
  },
  methods:{
    goLogin() {
      this.$router.push('/login')
    }
  }
}
</script>

<style scoped>

</style>